package com.cxso.example.client;


import com.cxso.example.enums.ProductClientEnum;
import com.cxso.example.request.wlpt.*;
import com.cxso.example.response.wlpt.*;
import com.cxso.example.sdk.domain.Result;
import com.cxso.example.sdk.http.base.HttpMethod;
import com.cxso.example.sdk.http.client.Client;
import com.cxso.example.sdk.http.core.ChoiceClient;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.HashMap;
import java.util.List;


@Schema(description = "聚合货主服务")
public class MergeOwnerWlptClient extends Client {

    public MergeOwnerWlptClient(ChoiceClient choiceClient) {
        super(choiceClient);
    }

    @Schema(description = "新增货源")
    public Result<ApiConsignorGoodsCreateRes> goodsCreate(ApiConsignorGoodsCreateReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/createGoods", HttpMethod.POST, request).toEntity(ApiConsignorGoodsCreateRes.class);
    }

    @Schema(description = "货源接单")
    public Result<ApiConsignorGoodsAcceptRes> goodsAccept(ApiConsignorGoodsAcceptReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/operateGoodsAccept", HttpMethod.POST, request).toEntity(ApiConsignorGoodsAcceptRes.class);
    }

    @Schema(description = "取消货源")
    public Result<ApiConsignorGoodsCancelRes> goodsCancel(ApiConsignorGoodsCancelReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/cancelGoods", HttpMethod.POST, request).toEntity(ApiConsignorGoodsCancelRes.class);
    }

    @Schema(description = "新增运单")
    public Result<ApiConsignorWaybillCreateRes> waybillCreate(ApiConsignorWaybillCreateReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/createWaybill", HttpMethod.POST, request).toEntity(ApiConsignorWaybillCreateRes.class);
    }

    @Schema(description = "编辑运单")
    public Result<ApiConsignorWaybillEditRes> waybillEdit(ApiConsignorWaybillEditReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/modifyWaybill", HttpMethod.PUT, request).toEntity(ApiConsignorWaybillEditRes.class);
    }

    @Schema(description = "运单提货")
    public Result<ApiConsignorWaybillPickGoodsRes> waybillPickGoods(ApiConsignorWaybillPickGoodsReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/operateWaybillPickGoods", HttpMethod.POST, request).toEntity(ApiConsignorWaybillPickGoodsRes.class);
    }

    @Schema(description = "运单运抵")
    public Result<ApiConsignorWaybillArriveRes> waybillArrive(ApiConsignorWaybillArriveReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/operateWaybillArrive", HttpMethod.POST, request).toEntity(ApiConsignorWaybillArriveRes.class);
    }

    @Schema(description = "运单签收")
    public Result<ApiConsignorWaybillSignRes> waybillSign(ApiConsignorWaybillSignReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/operateWaybillSign", HttpMethod.POST, request).toEntity(ApiConsignorWaybillSignRes.class);
    }

    @Schema(description = "运单取消")
    public Result<ApiConsignorWaybillCancelRes> waybillCancel(ApiConsignorWaybillCancelReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/cancelWaybill", HttpMethod.POST, request).toEntity(ApiConsignorWaybillCancelRes.class);
    }

    @Schema(description = "运单轨迹")
    public Result<ApiConsignorWaybillTrajectoryRes> waybillTrajectory(ApiConsignorWaybillTrajectoryReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/createWaybillTrajectory", HttpMethod.POST, request).toEntity(ApiConsignorWaybillTrajectoryRes.class);
    }

    @Schema(description = "申请支付")
    public Result<ApiConsignorPaymentApplyRes> paymentApply(ApiConsignorPaymentApplyReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/operatePaymentApply", HttpMethod.POST, request).toEntity(ApiConsignorPaymentApplyRes.class);
    }

    @Schema(description = "撤销支付")
    public Result<ApiConsignorPaymentRevokeRes> paymentRevoke(ApiConsignorPaymentRevokeReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/operatePaymentRevoke", HttpMethod.POST, request).toEntity(ApiConsignorPaymentRevokeRes.class);
    }

    @Schema(description = "确认支付")
    public Result<ApiConsignorPaymentConfirmRes> paymentConfirm(ApiConsignorPaymentConfirmReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/operatePaymentConfirm", HttpMethod.POST, request).toEntity(ApiConsignorPaymentConfirmRes.class);
    }

    @Schema(description = "申请开票")
    public Result<ApiConsignorInvoiceApplyRes> invoiceApply(ApiConsignorInvoiceApplyReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/operateInvoiceApply", HttpMethod.POST, request).toEntity(ApiConsignorInvoiceApplyRes.class);
    }

    @Schema(description = "撤销开票")
    public Result<ApiConsignorInvoiceRevokeRes> invoiceRevoke(ApiConsignorInvoiceRevokeReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/operateInvoiceRevoke", HttpMethod.POST, request).toEntity(ApiConsignorInvoiceRevokeRes.class);
    }

    @Schema(description = "新增合同")
    public Result<ApiConsignorContractCreateRes> contractCreate(ApiConsignorContractCreateReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/createContract", HttpMethod.POST, request).toEntity(ApiConsignorContractCreateRes.class);
    }

    @Schema(description = "新增收款信息")
    public Result<ApiConsignorPayPasswordModifyRes> payPasswordModify(ApiConsignorPayPasswordModifyReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/modifyPayPassword", HttpMethod.POST, request).toEntity(ApiConsignorPayPasswordModifyRes.class);
    }

    @Schema(description = "支付结果查询")
    public Result<ApiConsignorPaymentResultQueryRes> paymentResultQuery(ApiConsignorPaymentResultQueryReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/queryPaymentResult", HttpMethod.POST, request).toEntity(ApiConsignorPaymentResultQueryRes.class);
    }

    @Schema(description = "支付信息查询")
    public Result<List<ApiConsignorPaymentInfoQueryRes>> paymentInfoQuery(ApiConsignorPaymentInfoQueryReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/queryPaymentInfo", HttpMethod.POST, request).toList(ApiConsignorPaymentInfoQueryRes.class);
    }

    @Schema(description = "运单信息查询")
    public Result<ApiConsignorWaybillInfoQueryRes> waybillInfoQuery(ApiConsignorWaybillInfoQueryReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/queryWaybillInfo", HttpMethod.POST, request).toEntity(ApiConsignorWaybillInfoQueryRes.class);
    }

    @Schema(description = "运单轨迹查询")
    public Result<ApiConsignorWaybillTrajectoryQueryRes> waybillTrajectoryQuery(ApiConsignorWaybillTrajectoryQueryReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/queryWaybillTrajectory", HttpMethod.POST, request).toEntity(ApiConsignorWaybillTrajectoryQueryRes.class);
    }

    @Schema(description = "钱包信息查询")
    public Result<ApiConsignorWalletInfoQueryRes> walletInfoQuery(HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/queryWalletInfo", HttpMethod.POST, new ApiConsignorWalletInfoQueryReq()).toEntity(ApiConsignorWalletInfoQueryRes.class);
    }

    @Schema(description = "货主信息查询")
    public Result<ApiConsignorOwnerInfoQueryRes> ownerInfoQuery(HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/queryOwnerInfo", HttpMethod.POST, new ApiConsignorOwnerInfoQueryReq()).toEntity(ApiConsignorOwnerInfoQueryRes.class);
    }

    @Schema(description = "发票信息查询")
    public Result<ApiConsignorInvoiceInfoQueryRes> invoiceInfoQuery(ApiConsignorInvoiceInfoQueryReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/queryInvoiceInfo", HttpMethod.POST, request).toEntity(ApiConsignorInvoiceInfoQueryRes.class);
    }

}
